{{--默认文章列表页模板--}}
@extends('theme.jishupucms.layouts.app')

{{-- head投放区域 --}}
@section('head-css-cast')
    @parent
    <link rel="stylesheet" href="{{config('jishupucms.css')}}/image-preview-modal.min.css">
@endsection
@section('head-js-cast')
    @parent
@endsection

{{-- seo --}}
@section('title', $meta['title'])
@section('keywords', $meta['keywords'])
@section('description', $meta['description'])

{{--body class--}}
@section('body-class', 'jsp-bg')

{{-- 核心内容 --}}
@section('content')
    @parent

    {{-- banner --}}
    <section class="jsp-banner-section">
        <x-carousel id="carousel-{{$category->id}}" class="" :list="$ads"/>
    </section>

    {{--面包屑--}}
    <x-breadcrumb :list="$breadcrumb" :class="empty($ads) || $ads->isEmpty() ?'jsp-navheight':''"/>

    {{--内容区域--}}
    <section class="info-news jsp-content-section container">
        <div class="left title-desc-list ">
            {{--搜索区域--}}
            <form class="search  mb-3 float-right" action="{{$category->href}}">
                @csrf
                <div class="form-row align-items-center">
                    <div class="col-auto">
                        <label class="sr-only" for="inlineFormInput">{{__('common.keywords')}}</label>
                        <input type="text" class="form-control mb-2" name="keywords" value="{{$keywords}}"
                               placeholder="{{__('common.please_enter_kw')}}">
                    </div>
                    <div class="col-auto">
                        <button type="submit" class="btn btn-primary mb-2">{{__('common.search')}}</button>
                    </div>
                </div>
            </form>

            <div class="clearfix"></div>

            <div class="row">
                @if (isset($list) && !empty($list))
                    @foreach ($list as $item)
                        <div class="news-col col-xl-6 col-lg-6 col-md-12 col-sm-12 ">
                            <a  {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}>
                                <div class="time">
                                    <span class="day">{{$item->created_at->format('d')}}</span>
                                    <span class="date">{{$item->created_at->format('Y-m')}}</span>
                                </div>
                                <div class="title-desc">
                                    <h4 class="title"> {{strLimit($item['title'],100, '...')}}</h4>
                                    <p class="desc">{{strLimit($item['description'],120, '...')}}</p>
                                </div>
                            </a>
                        </div>
                    @endforeach
                @endif
            </div>
            {{--分页--}}
            {{$list->links('vendor.pagination.jishupu')}}
        </div>

        <!-- <div class="right">
          <h3 class="mb-3 pb-3 block-title">right</h3>
        </div> -->
    </section>

@endsection

{{-- 底部投放区域 --}}
@section('footer-cast')
    @parent
@endsection
